Vignette is built around a simple workflow: configure your site and personas once in TypeScript, then focus on writing Markdown or MDX files under posts/. This guide covers how the theme is structured, how to fill out frontmatter, and a few important details to keep in mind as you publish.

Setting Up the Theme

Before writing your first post, review the two main configuration files in src/settings/:

  • src/settings/site.settings.ts — Sets the site title, description, canonical url, defaultLocale, timezone, and optional features such as Giscus comments, analytics, and PWA offline caching.
  • src/settings/personas.settings.ts — Defines your editorial personas inside PERSONAS, including each persona’s avatar, optional social links, and localized descriptions.

PERSONAS must contain at least one entry. Every personas value used in a post’s frontmatter must match a key defined in PERSONAS.

Where Posts Live

Place .md or .mdx files anywhere inside posts/, typically grouped by language folder:

posts/
├── en/
│   └── my-first-post.md
└── ko/
    └── my-first-post.md

The filename (without extension) becomes the post’s URL slug. If two posts in different languages share the same filename—for example posts/en/my-first-post.md and posts/ko/my-first-post.md—Vignette automatically links them together so readers can switch languages from the corner of the frame.

Frontmatter Reference

Each post starts with a YAML frontmatter block validated at build time against the schema in src/content.config.ts:

---
title: My First Post
description: A brief summary shown on cards and in SEO metadata.
personas: [About the theme]
date: 2026-11-28 18:00:00 +0900
last_modified_at: 2026-11-28 18:00:00 +0900
lang: en
toc: true
math: false
mermaid: false
draft: false
---

Required Fields

  • title — Post heading and <title> metadata.
  • date — Publication timestamp (e.g. 2026-11-28 18:00:00 +0900). If you omit the timezone offset, Vignette falls back to SITE.timezone.
  • lang — A valid BCP 47 language code (en, ko, ja, zh-CN, zh-TW, es, fr, etc.). Posts in defaultLocale are served at the root, while other locales are automatically prefixed (such as /ko/...).

Optional Fields

  • description — Short summary used on post cards, RSS feeds, and meta tags.
  • last_modified_at — Updated timestamp shown in the post colophon.
  • personas — A persona ID or array of IDs from PERSONAS (e.g. [About the theme]). Defaults to the first persona in PERSONAS if omitted.
  • toc — Set to true to display the sticky Table of Contents on desktop.
  • math — Set to true to enable KaTeX math rendering for $...$ and $$...$$.
  • mermaid — Set to true to load Mermaid for ```mermaid diagram blocks.
  • draft — Set to true to exclude the post from production builds.
  • og_image / image — Custom social preview or header image. Paths must be absolute from public/ (starting with /) or full https:// URLs.
  • redirect_from — Array of legacy paths that should redirect to this post.

Writing & Formatting Caveats

A few deliberate behaviors in Vignette differ from generic Markdown setups:

  1. Use absolute paths for local images — Place assets in public/assets/... and reference them as /assets/... (not ./assets/...). This ensures images resolve consistently across nested locale/persona routes and subpath deployments.
  2. Math is opt-in per post — Unless math: true is set in frontmatter, $...$ and $$...$$ remain literal text so dollar amounts like $10 are never accidentally parsed as equations.
  3. Strikethrough requires double tildes — Single-tilde strikethrough is disabled so numeric ranges like 1~2 stay intact. Always use ~~strikethrough~~.
  4. Captions and image modifiers — Place an italicized line immediately below an image (*Caption text*) to render a caption, and attach class attributes such as {: .left }, {: .right }, {: .border }, or {: .img-light } / {: .img-dark } for theme-aware illustrations.
  5. Callouts and embeds — Use container directives (:::info, :::tip, :::warning, :::danger) for callouts, and :::youtube or ::video / ::audio for media.

Checking and Building

Before publishing, run the type and schema check alongside the production build:

npm run check
npm run build

npm run check validates frontmatter fields, persona IDs, and locale codes, while npm run build checks for route conflicts, compiles static HTML to dist/, and generates the Pagefind search index.